const {aliyunMessageParams} = require('./configParams')
const axios = require('axios')

const sendMsgCode = (phone, randomCode) => {
    return axios({
        method: 'post',
        url: aliyunMessageParams.url,
        data: {
            appid: aliyunMessageParams.appid,
            appSecret: aliyunMessageParams.appSecret,
            code: randomCode,
            phoneNum: phone,
            templateCode: aliyunMessageParams.templateCode
        }
    })
}

module.exports = sendMsgCode